﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Domain.Entities;

namespace System.Domain.IRepository
{
    public interface IMenuRepository
    {
        /// <summary>
        /// 获取所有菜单列表
        /// </summary>
        /// <returns></returns>
        Task<List<Menu>> GetAllMenusAsync();
        /// <summary>
        /// 获取菜单树形
        /// </summary>
        /// <returns></returns>
        Task<List<Menu>> GetMenuTreeAsync(int roleId);
        /// <summary>
        /// 获取子集列表
        /// </summary>
        /// <returns></returns>
        Task<List<Menu>> GetChildListAsync(int parentId);
        /// <summary>
        /// 获取单个实体
        /// </summary>
        /// <returns></returns>
        Task<Menu> GetEntityAsync(int menuId);
        /// <summary>
        /// 新增一个实体
        /// </summary>
        /// <returns></returns>
        Task<bool> InsertAsync(Menu menu);
        /// <summary>
        /// 修改一个实体
        /// </summary>
        /// <param name="menu"></param>
        /// <returns></returns>
        Task<bool> UpdateAsync(Menu menu);
        /// <summary>
        /// 删除一个实体
        /// </summary>
        /// <param name="menu"></param>
        /// <returns></returns>
        Task<bool> DeleteAsync(List<int> ids);
        /// <summary>
        /// 根据请求页面路径查询子级列表（1菜单目录，2按钮，3接口）
        /// </summary>
        /// <param name="url">请求路径</param>
        /// <param name="typeid">菜单类型：1菜单目录，2按钮，3接口</param>
        /// <returns></returns>
        Task<List<Menu>> GetButtonlist(string url, int typeid, int roleId);
    }
}
